﻿#region using
using System;
using System.Collections.Generic;
#endregion

namespace AwesomeTanks.Sources.GameElements
{
    /// <summary>
    /// The model of a Team in AwesomeTanks
    /// </summary>
    public class Team
    {
        #region Fields
        
        public List<Player> ListPlayers { get; set; }
        public String TeamName { get; set; }
        public TeamColor TeamColor { get; set; } 

        #endregion

        #region Constuctors

        /// <summary>
        /// Initializes a new instance of the <see cref="Team"/> class.
        /// </summary>
        /// <param name="name">The name.</param>
        /// <param name="teamcolor">The teamcolor.</param>
        /// <param name="listplayer">The listplayer.</param>
        public Team(String name,TeamColor teamcolor) : this(name,teamcolor,new List<Player>())
        {
        }

        public Team(String name, TeamColor teamcolor, List<Player> listplayer)
        {
            TeamName = name;
            TeamColor = teamcolor;
            ListPlayers = listplayer;
        }
        #endregion
     
        #region Methods

        /// <summary>
        /// Adds a player to the Team.
        /// </summary>
        /// <param name="player">The player.</param>
        public void AddPlayer(Player player)
        {
            ListPlayers.Add(player);
        }

        #endregion
    }
}
